module Sass::Script::Functions
  #TODO
  #gradients in IE 6-9 returns IE hex for color with alpha channel
  def ie_hex_str(color)
    assert_type color, :Color
    alpha = (color.alpha * 255).round
    alphastr = alpha.to_s(16).rjust(2, '0')
    Sass::Script::String.new("##{alphastr}#{color.send(:hex_str)[1..-1]}".upcase)
  end
  declare :ie_hex_str, [:color]
end
